home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / gtk-2.0 / gtk / gtkoldeditable.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-25  |  4.5 KB  |  129 lines

  1. /* GTK - The GIMP Toolkit
  2.  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Lesser General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.  * Lesser General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Lesser General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  */
  19.  
  20. /*
  21.  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
  22.  * file for a list of people on the GTK+ Team.  See the ChangeLog
  23.  * files for a list of changes.  These files are distributed with
  24.  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  25.  */
  26.  
  27. #ifndef GTK_DISABLE_DEPRECATED
  28.  
  29. #ifndef __GTK_OLD_EDITABLE_H__
  30. #define __GTK_OLD_EDITABLE_H__
  31.  
  32.  
  33. #include <gdk/gdk.h>
  34. #include <gtk/gtkeditable.h>
  35. #include <gtk/gtkwidget.h>
  36.  
  37. G_BEGIN_DECLS
  38.  
  39. #define GTK_TYPE_OLD_EDITABLE            (gtk_old_editable_get_type ())
  40. #define GTK_OLD_EDITABLE(obj)            (GTK_CHECK_CAST ((obj), GTK_TYPE_OLD_EDITABLE, GtkOldEditable))
  41. #define GTK_OLD_EDITABLE_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_OLD_EDITABLE, GtkOldEditableClass))
  42. #define GTK_IS_OLD_EDITABLE(obj)         (GTK_CHECK_TYPE ((obj), GTK_TYPE_OLD_EDITABLE))
  43. #define GTK_IS_OLD_EDITABLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_OLD_EDITABLE))
  44. #define GTK_OLD_EDITABLE_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_OLD_EDITABLE, GtkOldEditableClass))
  45.  
  46.  
  47. typedef struct _GtkOldEditable       GtkOldEditable;
  48. typedef struct _GtkOldEditableClass  GtkOldEditableClass;
  49.  
  50. typedef void (*GtkTextFunction) (GtkOldEditable  *editable, guint32 time_);
  51.  
  52. struct _GtkOldEditable
  53. {
  54.   GtkWidget widget;
  55.  
  56.   /*< public >*/
  57.   guint      current_pos;
  58.  
  59.   guint      selection_start_pos;
  60.   guint      selection_end_pos;
  61.   guint      has_selection : 1;
  62.  
  63.   /*< private >*/
  64.   guint      editable : 1;
  65.   guint      visible : 1;
  66.   
  67.   gchar *clipboard_text;
  68. };
  69.  
  70. struct _GtkOldEditableClass
  71. {
  72.   GtkWidgetClass parent_class;
  73.   
  74.   /* Bindings actions */
  75.   void (* activate)        (GtkOldEditable *editable);
  76.   void (* set_editable)    (GtkOldEditable *editable,
  77.                 gboolean        is_editable);
  78.   void (* move_cursor)     (GtkOldEditable *editable,
  79.                 gint            x,
  80.                 gint            y);
  81.   void (* move_word)       (GtkOldEditable *editable,
  82.                 gint            n);
  83.   void (* move_page)       (GtkOldEditable *editable,
  84.                 gint            x,
  85.                 gint            y);
  86.   void (* move_to_row)     (GtkOldEditable *editable,
  87.                 gint            row);
  88.   void (* move_to_column)  (GtkOldEditable *editable,
  89.                 gint            row);
  90.   void (* kill_char)       (GtkOldEditable *editable,
  91.                 gint            direction);
  92.   void (* kill_word)       (GtkOldEditable *editable,
  93.                 gint            direction);
  94.   void (* kill_line)       (GtkOldEditable *editable,
  95.                 gint            direction);
  96.   void (* cut_clipboard)   (GtkOldEditable *editable);
  97.   void (* copy_clipboard)  (GtkOldEditable *editable);
  98.   void (* paste_clipboard) (GtkOldEditable *editable);
  99.  
  100.   /* Virtual functions. get_chars is in paricular not a signal because
  101.    * it returns malloced memory. The others are not signals because
  102.    * they would not be particularly useful as such. (All changes to
  103.    * selection and position do not go through these functions)
  104.    */
  105.   void (* update_text)  (GtkOldEditable  *editable,
  106.              gint             start_pos,
  107.              gint             end_pos);
  108.   gchar* (* get_chars)  (GtkOldEditable  *editable,
  109.              gint             start_pos,
  110.              gint             end_pos);
  111.   void (* set_selection)(GtkOldEditable  *editable,
  112.              gint             start_pos,
  113.              gint             end_pos);
  114.   void (* set_position) (GtkOldEditable  *editable,
  115.              gint             position);
  116. };
  117.  
  118. GtkType    gtk_old_editable_get_type        (void) G_GNUC_CONST;
  119. void       gtk_old_editable_claim_selection (GtkOldEditable *old_editable,
  120.                          gboolean        claim,
  121.                          guint32         time_);
  122. void       gtk_old_editable_changed         (GtkOldEditable *old_editable);
  123.  
  124. G_END_DECLS
  125.  
  126. #endif /* __GTK_OLD_EDITABLE_H__ */
  127.  
  128. #endif /* GTK_DISABLE_DEPRECATED */
  129.